/*
 * @Author: lixu lixu@puchigames.com
 * @Date: 2025-01-03 16:49:48
 * @LastEditors: lixu lixu@puchigames.com
 * @LastEditTime: 2025-09-16 17:59:04
 * @FilePath: /go-helper/ixRedis/pubsub.go
 * @Description: Redis 发布订阅操作
 */
package ixRedis

import "github.com/garyburd/redigo/redis"

// Publish 发布消息
func (c *Client) Publish(channel string, message interface{}) (int64, error) {
	conn, err := c.getConn()
	if err != nil {
		return 0, err
	}
	defer conn.Close()

	return redis.Int64(conn.Do("PUBLISH", channel, message))
}
